<template>
  <div>
    <el-row style="margin-bottom: 8px;">
      <el-input v-model="currentTitleCaption" placeholder="请输入标题" />
    </el-row>
    <el-row>
      <tinymce v-model="currentContent" :height="150" placeholder="请输入问卷说明" font-color="#000000" />
    </el-row>
    <el-row style="height:32px">
      <el-row style="float:right;margin-top:4px;">
        <el-button size="mini" type="success" icon="el-icon-check" circle @click="handleSava" />
        <el-button size="mini" type="danger" icon="el-icon-close" circle @click="handleClose" />
      </el-row>
    </el-row>
  </div>
</template>
<script>
import Tinymce from '@/components/Tinymce'
export default {
  name: 'HeaderCaptionEdit',
  components: { Tinymce },
  props: {
    titleCaption: {
      type: String,
      default: function() {
        return ''
      }
    },
    content: {
      type: String,
      default: function() {
        return ''
      }
    }
  },
  data() {
    return {
      currentTitleCaption: this.titleCaption,
      currentContent: this.content
    }
  },
  methods: {
    handleSava() {
      this.$emit('save', this.currentTitleCaption, this.currentContent)
    },
    handleClose() {
      this.$emit('close')
    }
  }
}
</script>
